export const extractProp = (key, data) => {
    let newArray = []
    if (data) {
        data.forEach(item => {
            if (Object.keys(item).includes(key)) {
                newArray.push(item.key)
            }
        });
    }
    return newArray
}

export const findIdByName = (data, name) => {
    if (!data) return 0
    for (let i = 0; i < data.length; i++) {
        const item = data[i];
        if (item.title === name) {
            return item.id
        }
    }
}